package day05;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;

import java.util.Scanner;
public class Addition {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int score =0;
        for(int i =1;i<=10;i++){
            int a =(int)(Math.random()*100);
            int b =(int)(Math.random()*100);
            int result=a+b;//正确答案
            System.out.println("("+i+")"+a+"+"+b+"=?");//出题
            System.out.println("算吧");
            int answer=scan.nextInt();//答题
            if(answer==result){//判题
                System.out.println("答对了");
                score += 10;
            }else {
                System.out.println("答错了");
            }


        }
        System.out.println("你的成绩为"+score);

    }

}
